1. Field of the Invention
The present invention relates generally to computer assisted design (CAD) rendering, and more particularly to rendering vector-based fonts.
2. Related Art
Computer assisted design (CAD) systems construct, or render, two dimensional representations of three dimensional scenes. A user viewing the rendering can often rotate the image to view it from different vantage points, and zoom in or out to different resolutions to see all of the scene in less detail or a small part of the scene in great detail.
Some CAD systems represent the objects in a scene as vectors. A vector refers to a representation of graphical data, including CAD data, in which the elements in a graphical image are represented as lines and/or shapes, as opposed to raster data in which an image is represented as a collection of points or pixels.
Text in a CAD scene is also an object, and can be represented as a vector. The text in a CAD scene is often required to be viewed at different resolutions and orientations. Traditionally, text represented using vector based fonts has been rendered using standard line drawing algorithms. However, when these line drawing algorithms are used, scenes containing large amounts of text are rendered very slowly. This wastes the user's time, who must wait for the scene to finish rendering before continuing to work with the scene.
One solution to the rendering problems of speed and readability of text in a CAD drawing is to use a MIP map. A MIP map is an array of bitmap images used as surface textures when rendering a two dimensional representation of a three dimensional scene.
Each of the images stored in the MIP map holds a copy of the same texture but at a different scale from the other images. Each image at a given scale is a MIP map level. The largest-scale copy of the texture is used on surfaces close to the observer's viewpoint; while the smallest-scale image is used on the farthest surfaces. The MIP map levels normally differ from each other by powers of two. For example, the largest scale MIP map might have a resolution of 64×64 pixels, the next level at 32×32, then 16×16, 8×8 and so on.
An advantage of using MIP maps is that the pre-scaled versions of a single texture save the processing time that would be required to scale-down a large texture to make it usable on a “distant” surface. Scaling of textures is often still necessary, but by selecting the version of the texture which is closest to the required scale, the scaling process takes less time and reduces the possibility of errors, and the consequent distortion, introduced by the scaling process.
MIP maps are traditionally constructed by starting with the largest scale image, and averaging adjacent pixels in the image to get a color and brightness value for a pixel in the next smaller scale image. This next smaller scale image is then used to repeat the process to obtain a still smaller scale image. This approach does not work well with text represented by vector-based fonts, however. Text is usually made up of thin line segments, which quickly average into the background when this iterative approach is used. Thus, text becomes essentially invisible at the small scales of larger “distances” from the viewer's perspective. This is a problem especially with “stick” fonts, which have no filled regions in the glyphs and do not get wider when zoomed in on. A glyph is a graphical representation of a character in a font.
FIG. 1 depicts an embodiment of a text rendering according to conventional rendering techniques. Specifically, FIG. 1 shows six lines of text, at progressively smaller resolutions that are not anti-aliased. The lines in the glyphs that make up the text are jagged, not smooth, making some glyphs more difficult to read against the background. The glyphs rendered in this way also take a comparatively long time to render.
What is needed then is an improved method of rendering vector based fonts that overcomes shortcomings of conventional solutions.